package com.nineclock.message.listener;


import com.nineclock.message.service.MessageService;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@Slf4j
@RocketMQMessageListener(topic = "allowedJoinCompanyTopic", consumerGroup = "allowedJoinCompanyConsumer")
public class AllowedJoinCompanyListener implements RocketMQListener<String> {
    @Autowired
    MessageService messageService;


    @Override
    public void onMessage(String message) {
        log.info("接收到加入团队审核通过的消息 , 消息内容为 : " + message);
        messageService.updateMessageWithApproved(message);
    }
}
